{% extends '@EasyWorkflow/base.html.twig' %}

{% block content %}
    <div class="col-md-10">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>系统设置</h1>
                </div>
                <ol class="breadcrumb">
                    <li><a href="{{ path('easyworkflow_flowsetting_index') }}">流程配置</a></li>
                    <li><a href="{{ path('easyworkflow_flowsetting_flow', {flowCode:flow.code}) }}">{{ flow.name }}</a></li>
                    <li class="active">修改节点</li>
                </ol>
            </div>
        </div>
        {% include '@EasyWorkflow/_flash_messages.html.twig' %}
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="text-muted bootstrap-admin-box-title">修改节点</div>
                    </div>
                    <div class="bootstrap-admin-panel-content text-muted" style="padding: 60px 0;">
                        <div class="row">
                            <div class="col-md-6 col-md-offset-3">
                                <form action="{{ path('easyworkflow_flowsetting_editnode', {id:flowNode.id}) }}"
                                      method="post">
                                    <div class="form-group">
                                        <label for="flowNodeName"><span class="text-danger">*</span> 节点名称</label>
                                        <input type="text" name="name" class="form-control" id="flowNodeName"
                                               placeholder="节点名称"
                                               value="{% if flowNode %}{{ flowNode.name }}{% endif %}">
                                    </div>
                                    <div class="form-group">
                                        <label for="route"><span class="text-danger">*</span> 路由</label>
                                        <select class="form-control" name="route" id="route">
                                            <option value="">--请选择--</option>
                                            {% for route in flow.routes %}
                                                <option value="{{ route }}"
                                                        {% if flowNode and route == flowNode.route %}selected{% endif %}>{{ route }}</option>
                                            {% endfor %}
                                        </select>
                                    </div>
                                    <div class="form-group">
                                        <label for="route"><span class="text-danger">*</span> 处理群组</label>
                                        <div class="input-group">
                                            {% for group in groups %}
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="groups[]" value="{{ group.id }}" {% if flowNode and group in flowNode.groups %}checked{% endif %}> {{ group.groupName }}
                                                </label>
                                            {% endfor %}
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="description">备注</label>
                                        <textarea name="description" id="description" cols="30" rows="3"
                                                  class="form-control">{{ flowNode.description }}</textarea>
                                    </div>
                                    <button type="submit" class="btn btn-primary btn-sm"><i
                                                class="glyphicon glyphicon-hand-up"></i> 确定提交
                                    </button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}